<div class="row">
    <div class="transactions col-md-10">
        <h2><kbd><?php echo __('Transaction'); ?></kbd></h2>
        <table class="table table-bordered">
            <tr class="success">
                <td>Id</td>
                <td>Category</td>
                <td>Wallet</td>
                <td>Money</td>
                <td>With Who</td>
                <td>Created</td>
                <td>Updated</td>
            </tr>
            <tr>
                <td><?php echo h($transaction['Transaction']['id']); ?></td>
                <td><?php echo $this->Html->link($transaction['Category']['name'], array('controller' => 'categories', 'action' => 'view', $transaction['Category']['id'])); ?></td>
                <td><?php echo $this->Html->link($transaction['Wallet']['name'], array('controller' => 'wallets', 'action' => 'view', $transaction['Wallet']['id'])); ?></td>
                <td><?php $money = $transaction['Transaction']['money'];echo number_format($money)." VNĐ"; ?></td>
                <td><?php  echo h($transaction['Transaction']['with_who']);?></td>
                <td><?php  echo h($transaction['Transaction']['created']); ?></td>
                <td><?php  echo h($transaction['Transaction']['updated']); ?></td>
            </tr>
        </table>
    </div>
    <div class="actions col-md-2">
        <h2><kbd><?php echo __('Actions'); ?></kbd></h2>
        <hr/>
        <ul class="nav nav-stacked">
            <li><?php echo $this->Html->link(__('Edit Transaction'), array('action' => 'edit', $transaction['Transaction']['id'])); ?> </li>
            <li><?php echo $this->Form->postLink(__('Delete Transaction'), array('action' => 'delete', $transaction['Transaction']['id']), null, __('Are you sure you want to delete # %s?', $transaction['Transaction']['id'])); ?> </li>
            <li><?php echo $this->Html->link(__('List Transactions'), array('action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Transaction'), array('action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Categories'), array('controller' => 'categories', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Category'), array('controller' => 'categories', 'action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Wallets'), array('controller' => 'wallets', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Wallet'), array('controller' => 'wallets', 'action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Transactions'), array('controller' => 'transactions', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Parent Transaction'), array('controller' => 'transactions', 'action' => 'add')); ?> </li>
        </ul>
    </div>
    <div class="related">
        <h3><?php echo __('Related Transactions'); ?></h3>
        <?php if (!empty($transaction['ChildTransaction'])): ?>
            <table cellpadding = "0" cellspacing = "0">
                <tr>
                    <th><?php echo __('Id'); ?></th>
                    <th><?php echo __('Category Id'); ?></th>
                    <th><?php echo __('Wallet Id'); ?></th>
                    <th><?php echo __('Parent Id'); ?></th>
                    <th><?php echo __('Money'); ?></th>
                    <th><?php echo __('Created'); ?></th>
                    <th><?php echo __('Updated'); ?></th>
                    <th><?php echo __('Deleted'); ?></th>
                    <th><?php echo __('With Who'); ?></th>
                    <th><?php echo __('Position'); ?></th>
                    <th class="actions"><?php echo __('Actions'); ?></th>
                </tr>
                <?php foreach ($transaction['ChildTransaction'] as $childTransaction): ?>
                    <tr>
                        <td><?php echo $childTransaction['id']; ?></td>
                        <td><?php echo $childTransaction['category_id']; ?></td>
                        <td><?php echo $childTransaction['wallet_id']; ?></td>
                        <td><?php echo $childTransaction['parent_id']; ?></td>
                        <td><?php echo $childTransaction['money']; ?></td>
                        <td><?php echo $childTransaction['created']; ?></td>
                        <td><?php echo $childTransaction['updated']; ?></td>
                        <td><?php echo $childTransaction['deleted']; ?></td>
                        <td><?php echo $childTransaction['with_who']; ?></td>
                        <td><?php echo $childTransaction['position']; ?></td>
                        <td class="actions">
                            <?php echo $this->Html->link(__('View'), array('controller' => 'transactions', 'action' => 'view', $childTransaction['id'])); ?>
                            <?php echo $this->Html->link(__('Edit'), array('controller' => 'transactions', 'action' => 'edit', $childTransaction['id'])); ?>
                            <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'transactions', 'action' => 'delete', $childTransaction['id']), null, __('Are you sure you want to delete # %s?', $childTransaction['id'])); ?>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </table>
        <?php endif; ?>

        <div class="actions">
            <ul>
                <li><?php echo $this->Html->link(__('New Child Transaction'), array('controller' => 'transactions', 'action' => 'add')); ?> </li>
            </ul>
        </div>
    </div>
</div>
